package com.example.lib_common.utils

import android.content.Context
import android.util.Log
import kotlin.math.log

/**
 * @author yaotianxue
 * @description
 * @date 2025/2/14
 */
object AutoSizeUtils {
    fun dpToPx(context: Context, dp: Int):Int{
        val density = context.resources.displayMetrics.density
        Log.d("AutoSizeUtils", "density: $density")
        return (dp * density).toInt()
    }
    fun pxToDp(context: Context, px: Int):Int{
        val density = context.resources.displayMetrics.density
        Log.d("AutoSizeUtils", "density: $density")
        return (px/density).toInt()
    }


}